﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Adams.Public.Web.Business.Web.Areas.Membership.Classifieds
{
    public class Create
    {
        public static Adams.Public.DataTransfer.Web.Areas.Membership.Classifieds.Create.PageLoad PageLoad(string token, int postingId)
        {
            var input = new Adams.Public.DataTransfer.Web.Areas.Membership.Classifieds.Create.PageLoadInput() {
                Token = token,
                PostingID = postingId
            };

            var model = Api.GetData<Adams.Public.DataTransfer.Web.Areas.Membership.Classifieds.Create.PageLoad>("Web/Membership/Classifieds/CreatePageLoad", input);
            return model;
        }

        public static Adams.Shared.Entities.Classifieds.CategoryCollection GetCategoriesByType(int typeId)
        {
            var input = new Adams.Public.DataTransfer.Web.Areas.Membership.Classifieds.Create.GetCategoriesByTypeInput() {
                TypeID = typeId
            };

            var model = Api.GetData<Adams.Shared.Entities.Classifieds.CategoryCollection>("Web/Membership/Classifieds/GetCategoriesByType", input);
            return model;
        }

        public static DataTransfer.FormOutput Save(Adams.Public.DataTransfer.Web.Areas.Membership.Classifieds.Create.FormInput input)
        {
            var model = Api.GetData<DataTransfer.FormOutput>("Web/Membership/Classifieds/Save", input);
            return model;
        }
    }
}
